<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>

<!-- <meta http-equiv="refresh" content="30"/> -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5/themes/default/easyui.css"></link>
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5/themes/icon.css"></link>
	<link rel="stylesheet" type="text/css" href="js/jquery-easyui-1.5/demo/demo.css"></link>
	<script language="JavaScript"  type="text/javascript" src="js/jquery-easyui-1.5/jquery.min.js"></script>
	<script language="JavaScript"  type="text/javascript" src="js/jquery-easyui-1.5/jquery.easyui.min.js"></script>
	<script language="JavaScript"  type="text/javascript" src="js/blockUI.js"></script>
	
<style type="text/css"> 
	table.t1 
	{ 
		border-collapse: collapse; 
		border: none; 
		width: 200px; 
	} 
	td.td1
	{ 
		border: solid #000 0px; 
	} 
</style> 
	
	<script type="text/javascript">
	 /*<![CDATA[*/ 
	            
	
	var gdeskid;
	var gdnum;
	function join()
	{
		 var text = $("#chatbtn1").val();
		  $("#chatbtn1").textbox("setValue","");
		   if(text.length==0)
				 return;
			 
			 var url ="joinDesk?srcDeskid="+gdeskid+"&destNum="+text;
			 $.get(url, function(data){
				if(data=="0")
				 {
					 $.messager.alert("操作提示", "该台号不存在！","info");
					 $('#chatbtn1').textbox('textbox').focus(); 
					 $('#dlg1').dialog('close'); 
				 }else
				 {
					 $('#dlg1').dialog('close');
					 refreshDeskStat();
					 $("#chatbtn1").textbox("setValue","");
					 var str="与"+text+"号合并";
					 $('#'+gdnum+'_span').html(str);
					 $('#'+gdnum+'_span').css("display","block");
				 }
				 
				
			 });
	}
	
	function change()
	{
		var text = $("#chatbtn").val();
		  $("#chatbtn").textbox("setValue","");
		   if(text.length==0)
				 return;
			 
			 var url ="changeDesk?srcDeskid="+gdeskid+"&destNum="+text;
			 $.get(url, function(data){
				 if(data=="2")
				 {
					 $.messager.alert("操作提示", "该台号已被合并！","info");
					 $("#chatbtn").textbox("setValue","");
					 $('#dlg').dialog('close'); 
					 
				 }else if(data=="0")
				 {
					 $.messager.alert("操作提示", "该台号不存在！","info");
					 $("#chatbtn").textbox("setValue","");
					 $('#dlg').dialog('close');  
				 }
				 else
				 {
					 $('#dlg').dialog('close');
					 $("#chatbtn").textbox("setValue","");
					 refreshDeskStat();
					 
					 var dis = $('#'+text+'_change').css("display");
					 if(dis=='block')
					 {
						 var str="与"+text+"号合并";
						 $('#'+gdnum+'_span').html(str);
						 $('#'+gdnum+'_span').css("display","block");
					 }
					
				 }
				 
			 });
	}
	
	
	 function clickQuery()
	 {
		 var tmp = encodeURIComponent($('#foodname').val());
		  var name = $.trim(tmp);  
		  if(name.length==0)
			  return;
		  var url = "getFoodByLike?foodname="+name;
		  $.get(url, function(data){
			  	$("#add").datagrid("loadData", data);
				
				$("#count").html(data.length);
			});
	 }
	 
	 function shishou_enter()
	 {     
	       if (event.keyCode == 13) 
	       {   
	    	   var yingshou = $('#yingshou').text();
	    	   var shishou = $('#shishou').val();
	    	   var zhaoling = parseFloat(shishou)-parseFloat(yingshou);
	    	  
	    	   $('#zhaoling').focus();
	    	   $('#zhaoling').val(zhaoling);
	    	   
	    	   
	       }
	 }
	 
	 function zhaoling_enter()
	 {     
	       if (event.keyCode == 13) 
	       {   
	    	   $('#queding').focus();
	       }
	 }
	 
	 var gid;
	 function overCar(id)
	 {
		 $('#pdlg').dialog('close');
		 $('#order').dialog('open');
		 $('#yingshou').html(fsum);
		 
		 $('#zhaoling').val("");
		 $('#shishou').val("");
		 
		 setTimeout(function(){
			
			 $('#shishou').focus();
			 
		 }, 100);
		 
		 
		 gid=id;
	 }
	 
	 function over()
	 {
		 $('#order').dialog('close');
		 var deskid =gdeskid;
		 var desknum = gdnum;
		 var url = "over_order?id="+gid+"&deskid="+deskid+"&sum="+fsum;
		  
		  $.get(url, function(data){
			  
			  
			  $('#ndlg').dialog('close');
			  $('#pdlg').dialog('close');
			  var p = self.parent;
			  p.parent.closetab(desknum+"号桌");
			  p.parent.closetab(desknum+"号桌_有未读消息");
			  
		  });
	 }
	
	
	$(document).ready(  
			  function(){
				  
				  
				  $('#foodname').textbox('textbox').keydown(function (e) {
					  clickQuery();
				  });
				   
				  var sh=(self.parent.gh-(self.parent.gh*0.12)-200)/2;
				  var sw=(self.parent.gw-(self.parent.gw*0.12)-200)/2;
				  $('#dlg').window('open').window('resize',{top: sh,left:sw});
				  $('#dlg1').window('open').window('resize',{top: sh,left:sw});
				  
				  
				  var dsh=(self.parent.gh-(self.parent.gh*0.12)-410)/2;
				  var dsw=(self.parent.gw-(self.parent.gw*0.12)-430)/2;
				  $('#pdlg').window('open').window('resize',{width:'430px',height:'410x',top: dsh,left:dsw});
				  
				  var esh=(self.parent.gh-(self.parent.gh*0.12)-190)/2;
				  var esw=(self.parent.gw-(self.parent.gw*0.12)-310)/2;
				  $('#dlgev').window('open').window('resize',{width:'310px',height:'190px',top: esh,left:esw});
				  
				  
				  
				  var qsh=(self.parent.gh-(self.parent.gh*0.12)-340)/2;
				  var qsw=(self.parent.gw-(self.parent.gw*0.12)-340)/2;
				  $('#qrdlg').window('open').window('resize',{width:'340px',height:'340px',top: qsh,left:qsw});
				  
				  
				  var osh=(self.parent.gh-(self.parent.gh*0.12)-300)/2;
				  var osw=(self.parent.gw-(self.parent.gw*0.12)-200)/2;
				  $('#order').window('open').window('resize',{width:'300px',height:'200px',top: osh,left:osw});
				  
				  
				 
				  $('#ndlg').window('open').window('resize',{width:'200px',height:'250px',top: dsh,left:dsw+430});

				  
				  $('#order').dialog('close');
				  $('#qrdlg').dialog('close');
				  $('#ndlg').dialog('close');
				  $('#dlgev').dialog('close');
				  $('#dlg').dialog('close');
				  $('#dlg1').dialog('close');
				  
				  $('#pdlg').dialog({
					    onClose:function(){
					    	var json = $.parseJSON("{\"total\":0,\"rows\":[],\"footer\":[]}");
							$("#ptable").datagrid("loadData", json);
					    }
					});
				  
				  $('#pdlg').dialog('close');
				  
				  $("#chatbtn").textbox({onClickButton:function(e){
					  change();
				  }});	
				  
				  
				  $("#chatbtn1").textbox({onClickButton:function(e){
					 join();
				  }});
				  
				  $('#chatbtn').textbox('textbox').keydown(function (e) {
				      if (e.keyCode == 13) {
				    	  change();

				      }
				  });
				  
				  $('#chatbtn1').textbox('textbox').keydown(function (e) {
				      if (e.keyCode == 13) {
				    	  join();

				      }
				  });
				  
				  
				  setInterval("refreshDeskStat()",1000);
	 });
	
	function refreshDeskStat()
	{
		var curid=$("#areaid").val();
		if(curid==self.parent.gareaid)
		{
			var url ="show_deskstat?areaid="+self.parent.gareaid;
			$.get(url, function(data){
				 $.each( data, function(index, content)
				 { 
					 var tid="#"+content.id+"_tbl";
					 var dc="#"+content.idnum+"_change";
					 var dj="#"+content.idnum+"_join";
					 var dcan="#"+content.idnum+"_cancel";
					 
					 if(content.flag=='0')
					 {
						 $(dc).css("display","none");
						 $(dj).css("display","block");
						 $(dcan).css("display","none");
						 $(tid).css("background-color","#D3D3D3"); 
						 $('#'+content.idnum+'_span').css("display","none");
						 
						 $("#"+content.id+"_b1").removeClass();
						 $("#"+content.id+"_b2").removeClass();
						 $("#"+content.id+"_b3").removeClass();
						 $("#"+content.id+"_b4").removeClass();
						 
						 $("#"+content.id+"_c1").removeClass();
						 $("#"+content.id+"_c2").removeClass();
						 $("#"+content.id+"_c3").removeClass();
						 $("#"+content.id+"_c4").removeClass();
						 
						 $("#"+content.id+"_b1").addClass("xb1");
						 $("#"+content.id+"_b2").addClass("xb2");
						 $("#"+content.id+"_b3").addClass("xb3");
						 $("#"+content.id+"_b4").addClass("xb4");
						 
						 $("#"+content.id+"_c1").addClass("xb1");
						 $("#"+content.id+"_c2").addClass("xb2");
						 $("#"+content.id+"_c3").addClass("xb3");
						 $("#"+content.id+"_c4").addClass("xb4");
						 
					 }
					 	
					 else if(content.flag=='1')
					 {
						 $(dc).css("display","block");
						 $(dj).css("display","none");
						 $(dcan).css("display","none");
						 $(tid).css("background-color","#00a600");
						 
						 $("#"+content.id+"_b1").removeClass();
						 $("#"+content.id+"_b2").removeClass();
						 $("#"+content.id+"_b3").removeClass();
						 $("#"+content.id+"_b4").removeClass();
						 
						 $("#"+content.id+"_c1").removeClass();
						 $("#"+content.id+"_c2").removeClass();
						 $("#"+content.id+"_c3").removeClass();
						 $("#"+content.id+"_c4").removeClass();
						 
						 $("#"+content.id+"_b1").addClass("xc1");
						 $("#"+content.id+"_b2").addClass("xc2");
						 $("#"+content.id+"_b3").addClass("xc3");
						 $("#"+content.id+"_b4").addClass("xc4");
						 
						 $("#"+content.id+"_c1").addClass("xc1");
						 $("#"+content.id+"_c2").addClass("xc2");
						 $("#"+content.id+"_c3").addClass("xc3");
						 $("#"+content.id+"_c4").addClass("xc4");
						 
					 }
						
					 else if(content.flag=='2')
					 {
						 $(dc).css("display","none");
						 $(dj).css("display","none");
						 $(dcan).css("display","block");
						 $(tid).css("background-color","#CC9966");
						 
						 $("#"+content.id+"_b1").removeClass();
						 $("#"+content.id+"_b2").removeClass();
						 $("#"+content.id+"_b3").removeClass();
						 $("#"+content.id+"_b4").removeClass();
						 
						 $("#"+content.id+"_c1").removeClass();
						 $("#"+content.id+"_c2").removeClass();
						 $("#"+content.id+"_c3").removeClass();
						 $("#"+content.id+"_c4").removeClass();
						 
						 $("#"+content.id+"_b1").addClass("xd1");
						 $("#"+content.id+"_b2").addClass("xd2");
						 $("#"+content.id+"_b3").addClass("xd3");
						 $("#"+content.id+"_b4").addClass("xd4");
						 
						 $("#"+content.id+"_c1").addClass("xd1");
						 $("#"+content.id+"_c2").addClass("xd2");
						 $("#"+content.id+"_c3").addClass("xd3");
						 $("#"+content.id+"_c4").addClass("xd4");
					 }
						 
			     });
			 });
		}
		
		
	}
	 
	 
	
	 
	 function changedesk(obj)
	 {
		 
		 $('#dlg').dialog('open');
		 gdeskid = $(obj).attr("name");
		 var num = $(obj).attr("id").split("_");
		 gdnum = num[0];
		 $('#chatbtn').textbox('textbox').focus(); 
	 }
	 
	 function joindesk(obj)
	 {
		 $('#dlg1').dialog('open');
		 gdeskid = $(obj).attr("name");
		 var num = $(obj).attr("id").split("_");
		 gdnum = num[0];
		 $('#chatbtn1').textbox('textbox').focus(); 
	 }
	 
	 function canceldesk(obj)
	 {
		 var deskid = $(obj).attr("name");
		 
		 var tmp = $(obj).attr("id").split("_");
		 var tnum = tmp[0];
		 
		 var tid="#"+deskid+"_tbl";
		 var dc="#"+tnum+"_change";
		 var dj="#"+tnum+"_join";
		 var dcan="#"+tnum+"_cancel";
		 
		 $(dc).css("display","none");
		 $(dj).css("display","block");
		 $(dcan).css("display","none");
		 $(tid).css("background-color","#D3D3D3"); 
		 $('#'+tnum+'_span').css("display","none");
		 
		 
		 $("#"+deskid+"_b1").removeClass();
		 $("#"+deskid+"_b2").removeClass();
		 $("#"+deskid+"_b3").removeClass();
		 $("#"+deskid+"_b4").removeClass();
		 
		 $("#"+deskid+"_c1").removeClass();
		 $("#"+deskid+"_c2").removeClass();
		 $("#"+deskid+"_c3").removeClass();
		 $("#"+deskid+"_c4").removeClass();
		 
		 $("#"+deskid+"_b1").addClass("xb1");
		 $("#"+deskid+"_b2").addClass("xb2");
		 $("#"+deskid+"_b3").addClass("xb3");
		 $("#"+deskid+"_b4").addClass("xb4");
		 
		 $("#"+deskid+"_c1").addClass("xb1");
		 $("#"+deskid+"_c2").addClass("xb2");
		 $("#"+deskid+"_c3").addClass("xb3");
		 $("#"+deskid+"_c4").addClass("xb4");
		 
		 var url ="cancelDesk?deskid="+deskid;
		 $.get(url, function(data){
			 refreshDeskStat();
		 });
		 
	 }
	 
	 function action(name,url)
		{
			self.parent.addPanel(name,url,0);
		}
	 
	
	 function formatColumn(val,row){
		 if(row.id=='sum')
			 {
			 	return '<input type="button" value="结算" onclick="overCar(\''+val+'\')" />';
			 }else
			 {
				 if(row.score=="0")
				 	return '<a href="#"  onclick="removeCar(\''+val+'\',\''+row.orgid+'\')">撤单</a>';
				 else
					 return '<a href="#"  onclick="getEvaluate(\''+row.orderid+'\',\''+row.foodname+'\')">查看评价</a>&nbsp;&nbsp;<a href="#"  onclick="removeCar(\''+val+'\',\''+row.orgid+'\')">撤单</a>';
			 }
			
		
	}
	 
	 var gdesknum;
	 function openDetail(obj)
	 {
		 var deskid = $(obj).attr("id");
		 gdeskid = deskid;
		 var desknum = $(obj).attr("name");
		 gdnum=desknum;
		 var deskname=obj.parentNode.id;
		 var url = "p_show_carlist?deskid="+deskid;
		 //action(desknum+"号桌_"+deskname,url);
		 
		 $("#pdlg").panel({title:desknum+"号桌订单"});
		 showchar(deskid,1);
		 
	 }
	 
	 var fsum;
	 
	 function showchar(deskid,flag)
	 {
         var url ="showCar?deskid="+deskid;
		 $.get(url, function(data){
			if(data.total!="0")
			{
				//$("#table").datagrid({showFooter: true});
				var foot = data.footer;
				fsum = foot[0].price;
				
				$("#ptable").datagrid("loadData", data);
			}else
			{
				//$("#table").datagrid({showFooter: false});
				var json = $.parseJSON("{\"total\":0,\"rows\":[],\"footer\":[]}");
				$("#ptable").datagrid("loadData", json);
			}
			
		 });
		 if(flag==1)
		 $('#pdlg').dialog('open');
	 }
	 
	
	 
	 function getEvaluate(orgid,name)
	 {
		 $('#dlgev').panel({title: name});
		 
		 var url ="getEvaluate?orgid="+orgid;
		 
		 $.get(url, function(data){
			 
			 $("#icon").empty();

			if(typeof(data.score)=="undefined")
			{
				return;
			}else
			{
				var exp="input[name='ev'][value="+data.score+"]";
				$(exp).attr("checked",true);
				var html="";
				var len=parseInt(data.score)/25;
				len = parseInt(len);
				for(i=0;i<=len;i++)
				{
					html=html+'<img width="40px" height="40px" src="img/nice.jpg"/>';
				}
				len=5-len-1;
				for(i=0;i<len;i++)
				{
					html=html+'<img width="40px" height="40px" src="img/bad.jpg"/>';
				}
				$("#icon").append(html); 
				
			    $("#remark").val(data.remark);
			    
			    $('#dlgev').dialog('open');
			}
        	 
         });
	 }
	 
	 
	 function removeCar(id,orderid)
	 {
		 var url = "del_order?id="+id+"&orderid="+orderid;
		  
		  $.get(url, function(data){
			  showchar(gdeskid);
		  });
	 }
	
	 
	 function close()
	 {
		 $("#foodname").textbox("setValue","");
		 var json = $.parseJSON("[]");
		 $("#add").datagrid("loadData", json);
	 }
	 
	 function opendlg()
	 {
		 $('#ndlg').dialog('open');
		 $('#foodname').textbox('textbox').focus(); 
	 }
	 
	 
	 function afterEdit(rowIndex,rowdata,changes)
	 {
		    var url ="updateCount?id="+rowdata.orderid+"&count="+rowdata.count;
		    $.get(url, function(data){
		    	showchar(gdeskid,1);
			});
	 }
	
	 function onClickRow(index,rowdata)
	 {
			 deskid=gdeskid;
			 var url = "add_order?foodid="+rowdata.id+"&deskid="+deskid+"&count="+rowdata.score+"&flag=1";
			  $.ajax(
			 			{
			 	        	url: url,
			 	        	async: false,//改为同步方式
			 	        	type: "GET",
			 	        	success: function (data) {
			 	        		 showchar(gdeskid,0);
			 	 			}
			 	 	});
		 
		 
	 }
	 
	 function cellclick(index, field){
         if(field=='score')
         {
       		$('#add')
 				.datagrid('beginEdit', index);
       		flag=1;
         }else
         {
        	 $('#add')
				.datagrid('endEdit', index);
         }
    }
	 
	 function cellclick2(index, field){
         if(field=='count')
         {
       		$('#ptable')
 				.datagrid('beginEdit', index);
         }else
         {
        	 $('#ptable')
				.datagrid('endEdit', index);
         }
    }
	 
	 function showQr(obj)
		{
		 	var dname = $(obj).attr("name");
		 	
		 	var deskid = $(obj).attr("id");
		 	
		 	var url ="show_qrImag?id="+deskid;
		 	$("#qrdlg").panel({title:dname});
		 	
		 	$.get(url, function(data){
				document.getElementById("qrimg").src="/qrimage/"+data;
				 $('#qrdlg').dialog('open');
			});
			
		 	
		}
	 
	
	/*]]>*/  
</script>
	
<style type="text/css">
	a:link,a:visited{
 		text-decoration:none;  /*超链接无下划线*/
	}
	a:hover{
 		text-decoration:none;  /*鼠标放上去有下划线*/
	}
	
	.fo{
		font-size: 25px;font-family:'微软雅黑';font-weight: bold;
	}
	.fo1{
		font-size: 25px;font-family:'微软雅黑';font-weight: bold;color: #009900;
		
	}
	
	.fo2{
		font-size: 25px;font-family:'微软雅黑';font-weight: bold;color: #ff0000;
		
	}
	.bo{
		border-left-width:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;
		font-size: 25px;font-family:'微软雅黑';font-weight: bold;
		color: #009900;
		width:80px;
		height:30px;
	}
	.bo1{
		border-left-width:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;
		font-size: 25px;font-family:'微软雅黑';font-weight: bold;
		color: #ff0000;
		width:80px;
		height:30px;
	}
</style>


<style type="text/css">

	.xtop, .xbottom {display:block; background:transparent; font-size:1px;}
	.xb1, .xb2, .xb3, .xb4 {display:block; overflow:hidden;}
	.xb1, .xb2, .xb3 {height:1px;}
	.xb2, .xb3, .xb4 {background:#D3D3D3; border-left:1px solid #D3D3D3; border-right:1px solid #D3D3D3;}
	.xb1 {margin:0 5px; background:#D3D3D3;}
	.xb2 {margin:0 3px; border-width:0 2px;}
	.xb3 {margin:0 2px;}
	.xb4 {height:2px; margin:0 1px;}
	
	.xc1, .xc2, .xc3, .xc4 {display:block; overflow:hidden;}
	.xc1, .xc2, .xc3 {height:1px;}
	.xc2, .xc3, .xc4 {background:#00a600; border-left:1px solid #00a600; border-right:1px solid #00a600;}
	.xc1 {margin:0 5px; background:#00a600;}
	.xc2 {margin:0 3px; border-width:0 2px;}
	.xc3 {margin:0 2px;}
	.xc4 {height:2px; margin:0 1px;}
	
	.xd1, .xd2, .xd3, .xd4 {display:block; overflow:hidden;}
	.xd1, .xd2, .xd3 {height:1px;}
	.xd2, .xd3, .xd4 {background:#CC9966; border-left:1px solid #CC9966; border-right:1px solid #CC9966;}
	.xd1 {margin:0 5px; background:#CC9966;}
	.xd2 {margin:0 3px; border-width:0 2px;}
	.xd3 {margin:0 2px;}
	.xd4 {height:2px; margin:0 1px;}
	
</style>

</head>
<body>
<script type="text/javascript">
</script>
<div style="width:100%;height:100%" align="center">
<table>
<div th:each="alist,iterStat:${list}"  >
<tr><td align="left">
 <table>
 	<tr>
		<div th:each="desk,iterStat:${alist}">  
		<td th:with="isEven=(${desk.flag} ne '1')"  >
		
		<b class="xtop">
			<b th:id="${desk.id}+'_b1'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb1': 'xc1') : 'xd1'" ></b>
			<b th:id="${desk.id}+'_b2'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb2': 'xc2') : 'xd2'" ></b>
			<b th:id="${desk.id}+'_b3'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb3': 'xc3') : 'xd3'"></b>
			<b th:id="${desk.id}+'_b4'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb4': 'xc4') : 'xd4'"></b>
		</b>
		
		 	<table  width="150px" th:id="${desk.id}+'_tbl'"  th:attr="bgcolor=(${desk.flag} ne '2')?	(${isEven}?'#D3D3D3': '#00a600') : '#CC9966'"  >
		 		<tr height="30px">
		 			<td  width="30px" align="left"  class="td1" >
		 				<a href="#"><span style="font-size:20px;font-weight: bold;color: #ff0000;"  th:id="${desk.id}" th:name="${desk.dname}" th:text="${desk.idnum}" onclick="showQr(this)"></span></a>
		 			</td>
		 			<td align="right" class="td1"><a href="#" th:id="${desk.dname}"><span  th:id="${desk.id}" style="font-size:20px;" th:name="${desk.idnum}" th:text="${desk.dname}" onclick="openDetail(this)"></span></a></td>
                    
		 		</tr>
		 		<tr height="30px" >
		 
		 			<td colspan="2"   align="center"   >
		 				<span style="font-size:30px;font-weight: bold;" th:text="${desk.count}+'人'"></span>
		
		 			</td>
		 			
		 		</tr>
		 		<tr height="20px">
		 
		 			<td colspan="2"   align="center" >
		 				<div th:with="huan=(${desk.flag} eq '1')?'block':'none'">
		 					<a  th:attr="style='display:'+${huan}+';'"  href="#" th:id="${desk.idnum}+'_change'" th:name="${desk.id}"   onclick="changedesk(this)">换&nbsp;台</a>
		 				</div>
		 				<div th:with="bing=(${desk.flag} eq '0')?'block':'none'"> 
		 					<a  th:attr="style='display:'+${bing}+';'"  href="#" th:id="${desk.idnum}+'_join'"  th:name="${desk.id}"  onclick="joindesk(this)">并&nbsp;台</a>
		 				</div>
		 				<div th:with="qu=(${desk.flag} eq '2')?'block':'none'">
		 					<a  th:attr="style='display:'+${qu}+';'"  href="#" th:id="${desk.idnum}+'_cancel'"  th:name="${desk.id}"  onclick="canceldesk(this)">取消并台</a>
		 				</div>
		 			</td>
		 			
		 		</tr>
		 		<tr height="30px">
		 			<td colspan="2"  align="center" >
		 				<div th:with="flag=(${desk.flag} eq '1')?'none':'none'">
		 					<span  th:attr="style='display:'+${flag}+';'" th:text="'已就餐：'+${desk.begintime}"></span>
		 				</div>
		 				<div th:with="flag1=(${desk.flag} eq '2')?'block':'none'">
		 					<span th:id="${desk.idnum}+'_span'"  th:attr="style='display:'+${flag1}+';'" th:text="'与'+${desk.othid}+'号合并'"></span>
		 				</div>
		 			</td>
		 		</tr>
		 		
		 	</table>
		 	
		 	   <b class="xbottom">
		 	   		<b th:id="${desk.id}+'_c4'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb4': 'xc4') : 'xd4'" ></b>
					<b th:id="${desk.id}+'_c3'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb3': 'xc3') : 'xd3'" ></b>
					<b th:id="${desk.id}+'_c2'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb2': 'xc2') : 'xd2'"></b>
					<b th:id="${desk.id}+'_c1'" th:attr="class=(${desk.flag} ne '2')?	(${isEven}?'xb1': 'xc1') : 'xd1'"></b>
		 	   	</b>
		</td>
		</div>
	</tr>
</table>
</td></tr>

</div>
</table>
</div>
<input  id="areaid" type="hidden" th:value="${areaid}" />
	<div id="dlg" class="easyui-dialog"  title="请输入要换的台号" style="width:200px;height:90px;padding:5px;"
			data-options="
				iconCls: 'icon-save',
				modal:true
			">
		<input class="easyui-textbox"  id="chatbtn" style="width:100%;height:40px;" data-options="buttonText:'换台'"/>
	</div>
	
	<div id="dlg1" class="easyui-dialog" title="请输入要并的台号" style="width:200px;height:90px;padding:5px;"
			data-options="
				iconCls: 'icon-save',
				modal:true
			">
		<input class="easyui-textbox"  id="chatbtn1" style="width:100%;height:40px;" data-options="buttonText:'并台'"/>
	</div>
	
	
	<div id="pdlg" class="easyui-dialog" data-options="modal:true,closed:true">
			
	  <table id="ptable" class="easyui-datagrid" style="width:100%;height:100%;"
			data-options="singleSelect:true,collapsible:false,showFooter: true,rownumbers: true,onClickCell:cellclick2,onAfterEdit:afterEdit,toolbar:'#tb'">
			<thead>
			<tr>
				<th data-options="field:'foodname'" width="30%">菜名</th>
				<th data-options="field:'price'" width="20%">价格</th>
				<th data-options="field:'count',editor:{type:'numberspinner',options:{min:1}}" width="20%">数量</th>
				<th data-options="field:'orderid',align:'right',formatter:formatColumn" width="30%">操作</th>

			</tr>
			</thead>
	</table>
	
	</div>
	
	<div id="tb" style="padding:2px 5px;">
		<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="opendlg()">新增菜单</a>
	</div>
	
	<div id="dlgev" class="easyui-dialog" title="客户评价" data-options="iconCls:'icon-info',modal:true" style="width:100%;height:100%;">
		<table width="100%">
          	 		<tr><td align="center" >
          	 			极差<input type="radio" name="ev" value="0" />&nbsp;&nbsp;&nbsp;
          	 			差<input type="radio" name="ev" value="25" />&nbsp;&nbsp;&nbsp;
          	 			一般<input type="radio" name="ev" value="50" />&nbsp;&nbsp;&nbsp;
          	 			好<input type="radio" name="ev" value="75" />&nbsp;&nbsp;&nbsp;
          	 			非常好<input type="radio" name="ev" value="100" />&nbsp;&nbsp;&nbsp;
          	 			
          	 			</td></tr>
          	 		</table>
          	 		
          	 		<div>
						<textarea class="comments" id="remark" cols="32"   placeholder="味道如何评价一下吧！" rows="4"></textarea>
					</div>
					<div id="icon"></div>
	</div>
	
	
	<div id="ndlg" class="easyui-dialog" title="新增菜单" data-options="iconCls:'icon-save',onClose:close">
		<table id="add" class="easyui-datagrid"  style="width:100%;height:100%;" 
			data-options="singleSelect:true,collapsible:false,onDblClickRow: onClickRow,onClickCell:cellclick,toolbar:'#tt'">
			<thead>
				<tr>
					<th data-options="field:'foodname'" width="50%">菜名</th>
					<th data-options="field:'price'" width="20%">价格</th>
					<th data-options="field:'score',align:'left',editor:{type:'numberspinner',options:{min:1}}" width="30%">数量</th>

				</tr>
			</thead>
		</table>
	</div>

	<div id="tt" style="padding:2px 5px;">
		
		<input class="easyui-textbox" data-options="prompt:'输入查询'" name ="foodname"  id="foodname" style="width:100px"/>
		<span id="count"></span>
		
	</div>
	
	<div class="easyui-dialog" data-options="closed:true" id="qrdlg" width="340px" height="340px">
		<center><img id="qrimg" width="300px" height="300px" /></center>
	</div>
	
	<div class="easyui-dialog" data-options="closed:true,title:'结账'" id="order" width="300px" height="200px">
		<center>
			<table>
				<tr>
					<td class="fo">应收：&nbsp;</td>
					<td align="left"><span class="fo1" id="yingshou"></span></td>
				</tr>
				<tr>
					<td class="fo">实收：&nbsp;</td>
					<td ><input class="bo" type="text" id="shishou" style="text-align: left;" onkeypress="shishou_enter()"/></td>
				</tr>
				<tr>
					<td class="fo">找零：&nbsp;</td>
					<td align="left"><input class="bo1" type="text" id="zhaoling" style="text-align: left;" onkeypress="zhaoling_enter()"/></td>
				</tr>
				
				<tr>
					<td colspan="2" align="center"><input height="50px" type="button" onclick="over()" id="queding" value="&nbsp;&nbsp;结 &nbsp;&nbsp;&nbsp;&nbsp;账&nbsp;&nbsp;"/></td>
				</tr>
			</table>
		</center>
	</div>
	
</body>
</html>